#!/bin/bash
set -euo pipefail
BaseDir=$(cd "$(dirname "$0")"; pwd)
cd ${BaseDir}

udocker ps|grep 'kasm' || {
    udocker pull registry.cn-beijing.aliyuncs.com/wushifeng/kasmweb-ubuntu-jammy-dind:1.15.0
    udocker images
    udocker create --name=kasm --force registry.cn-beijing.aliyuncs.com/wushifeng/kasmweb-ubuntu-jammy-dind:1.15.0
    udocker ps
}

#docker run --shm-size=6024m -p 6901:6901 -e VNC_PW=passdev -h kasmweb --privileged --name kasm kasmweb/ubuntu-dind-ime:1.15.0
udocker run -p 6901:6901 -e VNC_PW=passdev kasm    
:<<EOF
Executing command: '/dockerstartup/vnc_startup.sh /dockerstartup/kasm_startup.sh --tail-log'
+ exec /dockerstartup/vnc_startup.sh /dockerstartup/kasm_startup.sh --tail-log
hostname: Name or service not known
EOF